import { Column, Entity } from "typeorm";
import { BaseEntity } from "../../base/entity/base";

@Entity('order_info', { comment: '订单基础信息' })
export class OrderInfoEntity extends BaseEntity {
    @Column({ comment: '订单编号', unique: true, nullable: false })
    orderNo: string;

    @Column({ comment: '订单类型', dict: ['商品订单', '服务订单'] })
    type: string;

    @Column({ comment: '订单封面', nullable: true })
    cover: string;

    @Column({ comment: '订单价格', nullable: true })
    price: number;

    @Column({
        comment: '订单状态 0-待支付 1-已支付 2-进行中 3-已关闭 4-已完成',
        dict: ['待支付', '已支付', '进行中', '已关闭', '已完成'],
        default: 0,
    })
    status: number;

    @Column({
        comment: '订单来源 0-后台下单 1-H5 2-微信小程序 3-服务人员录入',
        dict: ['后台下单', 'H5', '微信小程序', '服务人员录入'],
        default: 0,
    })
    source: number;

    @Column({ comment: '用户ID', nullable: false })
    userId: number;

    @Column({ comment: '服务人员录入者ID', nullable: true })
    createdByProviderId: number;

    @Column({ comment: '团队ID', nullable: true })
    teamId?: number;

    @Column({ comment: '订单备注', nullable: true })
    remark: string;

}